package ys.ewp.po;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @description 通知（传阅）PO
 */
@Entity
@Table(name="tb_inform")
public class Inform extends BasePo {
	
	private String title;
	private String content;
	
	//创建者
	private Employee creator;
	
	//目标
	private List<Employee> targets = new ArrayList<Employee>();
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@ManyToOne
	@JoinColumn(name="creator_id")
	public Employee getCreator() {
		return creator;
	}
	public void setCreator(Employee creator) {
		this.creator = creator;
	}
	
	@ManyToMany
	@JoinTable(name="tb_inform_employee",
		joinColumns={@JoinColumn(name="inform_id")},
		inverseJoinColumns={@JoinColumn(name="employee_id")}
	)
	public List<Employee> getTargets() {
		return targets;
	}
	public void setTargets(List<Employee> targets) {
		this.targets = targets;
	}
	
}
